<h1>Listado de Personas</h1>
<% if flash[:notice] %>
    <div id="notice"><%= flash[:notice] %></div>
<% end %>
<% if @security_people.size > 0 %>
<table class="paginated_table sorted_table">
<thead>
  <tr>
    <th>Nombre</th>
    <th>Apellidos</th>   
    <th>Email</th>
    <th>Acciones</th>
  </tr>
</thead>
<tbody>
<% @security_people.each do |security_person| %>
  <tr>
    <td><%= security_person.name %></td>
    <td><%= security_person.lastname %></td>    
    <td><%= security_person.email %></td>
    <td>
      <%= link_to image_tag("navi/search-16-ns.png", :border => 0,:title=>"Mostrar"), security_person%>
      <% if (user_signed_in? && ([2].include?(current_user.role))) %>
    <%= link_to image_tag("navi/pencil-16-ns.png", :border => 0,:title=>"Editar"), edit_security_person_path(security_person) %>
    <%= link_to image_tag("navi/cross-16-ns.png", :border => 0,:title=>"Eliminar"), security_person, :confirm => 'Esta Seguro?', :method => :delete %>
      <%end%>
      
    </td>
  </tr>
<% end %>
</tbody>
</table>
<% else %>
  <p>Ninguna Persona Encontrada</p>
<% end %>
<br />

<% if (user_signed_in? && ([2].include?(current_user.role))) %>
<%= link_to 'Nueva Persona', new_security_person_path %>
<%end%>
